package com.example.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.example.demo.dto.ComboDto;
import com.woniuxy.movice.entity.Combo;

public interface ComboMapper {
	@Select("select * from combo")
	List<Combo> getAllCombo();
	
	@Select("select ttype as name,tcount as value from combo")
	List<ComboDto> getComboCount();
	
	@Delete("delete from combo where tid=#{tid}")
	int deleteCombo(int tid);

	@Insert("INSERT INTO combo (ttype,tprice,tyear) VALUES (#{ttype},#{tprice},#{tyear}) ")
	int addCombo(int tprice, String ttype, int tyear);
	
	@Update("update combo set tprice=#{tprice} where tid=#{tid}")
	int updateCombo(int tprice, int tid);
}
